import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import './plugins/element.js'
import ViewUI from 'view-design';
import 'view-design/dist/styles/iview.css';
import 'jquery'
import vueAplayer from 'vue-aplayer'
//屏幕分辨率适配
import './utils/lib-flexible/flexible'
// 导入全局样式表
import '@/assets/css/global.css'
import { MessageBox,Message } from 'element-ui';
import  DGlobalFuncDasConstants from './GlobalFuncDasConstants'
import Global_func from './Global_func'
import Viewer from 'v-viewer'
import 'viewerjs/dist/viewer.css'
// 1.全局引用
import VueVideoPlayer from 'vue-video-player'
import 'video.js/dist/video-js.css'
//vue-preview 开始
import VuePreview from 'vue-preview';
import axios from 'axios'
import { Loading } from 'element-ui';
import { Notification } from 'element-ui';
Vue.prototype.$notify =Notification;
//main.js
Vue.prototype.$EventBus = new Vue()//挂载全局EventBus
Vue.use(vueAplayer)
Vue.use(Loading.directive);
// defalut install
Vue.use(VuePreview)
Vue.use(VueVideoPlayer)
Vue.use(Viewer)
Vue.prototype.$axios = axios;
Viewer.setDefaults({
  Options: { 'inline': true, 'button': false, 'navbar': true,
    'title': true, 'toolbar': true, 'tooltip': true,
    'movable': true, 'zoomable': false, 'rotatable': true,
    'scalable': false, 'transition': false, 'fullscreen': false,
    'keyboard': true, 'url': 'data-source' },
  show: function (e) {
    console.log(e.type,'图片显示开始');
  },
  hide: function (e) {
    console.log(e.type,'图片隐藏完成');
  },
  hidden: function (e) {
    console.log(e.type,'图片隐藏结束');
  },
  view: function (e) {
    console.log(e.type,'视图开始');
  },
})
Vue.use(Global_func);
Vue.prototype.GlobalFuncDasConstants = DGlobalFuncDasConstants
Vue.use(ViewUI);
Vue.config.productionTip = false
Vue.prototype.$ = $
Vue.prototype.$confirm = MessageBox.confirm
Vue.prototype.$alert = MessageBox.alert
// Vue.prototype.$message = Message
Vue.prototype.$message = function (msg) {
  Message(msg)
}
Vue.prototype.$message = function(msg){
  return Message({
    message:msg,
    duration:2000
  })

}
Vue.prototype.$message.success = function (msg) {
  return Message.success({
    message: msg,
    duration: 1500
  })
}
Vue.prototype.$message.error = function (msg) {
  return Message.error({
    message: msg,
    duration: 1000
  })
}
Vue.prototype.$message.warning = function (msg) {
  return Message.warning({
    message: msg,
    duration: 1000
  })
}



new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')
